using System;
using System.Configuration;
using System.ServiceModel;
using System.Reflection;
using System.ServiceModel.Activation;
using System.Runtime.Serialization;
using CompanyX.TechnicalArchitecture.Factories;
using CompanyX.Insurance.La.DataContracts;
using CompanyX.Insurance.La.FaultContracts;
using CompanyX.Insurance.La.ServiceContracts;

/// <summary>
/// The framework's service end-point of L&amp;A new business. This service end-point
/// is designed to be ACORD v2.18.02 compliant (includes Microsoft-FSG specific schema 
/// extensions for operation faults). By default, this service uses the framework's 
/// provider however, the provider can be plugged into the appropriate backend system/service 
/// with optional message transformations
/// </summary>
/// <remarks>Security model is based on typical role definitions for the applicable process</remarks>
[ServiceBehavior(Name = "NewBusinessService", Namespace = "urn:CompanyX.Insurance.La.ServiceContracts")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class NewBusinessService : INewBusiness
{
    #region INewBusiness Members

    public TXLifeResponse SubmitNewBusinsssApplication(TXLifeRequest request)
    {
        ProviderFactoryConfig config = (ProviderFactoryConfig)ConfigurationManager.GetSection("serviceProviders");
        AssemblyName providerAssemblyName = new AssemblyName(config.Providers["LifeServiceProvider"].AssemblyFullName);
        ProviderFactory.LoadProvider(providerAssemblyName);

        INewBusiness provider = ProviderFactory.GetProvider<INewBusiness>();
        return provider.SubmitNewBusinsssApplication(request);
    }

    public TXLifeResponse OrderGeneralRequirement(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse GetGeneralRequirementStatusAndResult(TXLifeRequest request)
    {
        ProviderFactoryConfig config = (ProviderFactoryConfig)ConfigurationManager.GetSection("serviceProviders");
        AssemblyName providerAssemblyName = new AssemblyName(config.Providers["LifeServiceProvider"].AssemblyFullName);
        ProviderFactory.LoadProvider(providerAssemblyName);

        INewBusiness provider = ProviderFactory.GetProvider<INewBusiness>();
        return provider.GetGeneralRequirementStatusAndResult(request);
    }

    public TXLifeResponse SendGeneralRequirementStatusAndResult(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse GetGeneralRequirementStatus(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse SendGeneralRequirementStatus(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse NotifyCaseStatus(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse ProcessReplacement(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse UpdateReplacementProcessingStatus(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse UpdatePolicyOnUnderwritingAction(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse GetPolicyRequirementDetails(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse InquireMib(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse UpdateMib(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse SendMibInquiryFollowup(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse GetMibInquiryFollowup(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse DeclineRisk(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse GetPharmaceuticalInformation(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse SendPharmaceuticalInformation(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse SendDiscrepancyNotice(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    #endregion
}